<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <button>CLICK</button>
  <script>
    function TypeIs(v) {
      if (v === null) return 'null';
      if (v === undefined) return 'is undefined';
      return Object.prototype.toString.call(v).slice(8, -1)
    };

    function open() {
      let val = prompt('输入值')
      
      alert(TypeIs(val))
    }
    document.querySelector('button').onclick = open
  </script>
</body>

</html>